#include<iostream>
#include<vector>
#include<unordered_map>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_set>
#include<bits/stdc++.h>
#define fi first
#define se second
#define SIZE(x) ((int)x.size())
#define out(x) cerr<<#x<<" = "<<(x)<<endl;
#define MP(a,b) make_pair(a,b)
using namespace std;
typedef long long ll;
#define VI vector<int>
#define VVI vector< vector<int> >
#define VC vector<char>
#define PI pair<int,int>
#define PL pair<ll,ll>
#define EPS 0.000001


inline int lson(int x){return x<<1;}
inline int rson(int x){return (x<<1)|1;}

inline int read()
{
	int x=0,f=1;char ch=getchar();
	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
	while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
	return x*f;
}

template<typename T> 
inline void read(T &x){
	x=0;T f=1;char ch;
	do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
	do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}


//#define INF 5340172838076674L
#define INF 1000000000
#define MOD 100003
struct node{
	ll a,b;
	bool operator<(const node& x)const{
		return a<x.a;
	};
};

struct no{
	ll a,b,c;
	bool operator<(const no& x)const{
		return c<x.c;
	}
};

#define maxn 20005
struct EDGE{
	int next,to;
}edg[200005];
int n,m,esum=0,tim=0;
int h[maxn],dfn[maxn],low[maxn];
bool cut[maxn];
void add(int x,int y){
	edg[++esum].next=h[x];
	h[x]=esum;
	edg[esum].to=y;
}

void tarjan(int x,int fa){
	dfn[x]=low[x]=++tim;
	int child=0;
	for(int i=h[x];i;i=edg[i].next){
		int tmp=edg[i].to;
		if(!dfn[tmp]){
			tarjan(tmp,fa);
			low[x]=min(low[x],low[tmp]);
			if(low[tmp]>=dfn[x]&&x!=fa)cut[x]=true;
			if(x==fa)++child;
		}else low[x]=min(low[x],dfn[tmp]);
	}
	if(child>=2&&x==fa)cut[x]=true;
}

int main(){
    #ifdef BUG
    freopen("a.in","r",stdin);
    #endif
	memset(h,0,sizeof h);
	memset(dfn,0,sizeof dfn);
	memset(low,0,sizeof low);
	memset(cut,0,sizeof cut);
	n=read();m=read();
	int a,b;
	for(int i=0;i<m;i++){
		a=read();b=read();
		add(a,b);
		add(b,a);
	}
	for(int i=1;i<=n;i++)if(!dfn[i])tarjan(i,i);
	int tot=0;
	for(int i=1;i<=n;i++)if(cut[i])++tot;
	printf("%d\n",tot);
	for(int i=1;i<=n;i++)if(cut[i])printf("%d ",i);
}